import { EntitySchema } from '@mikro-orm/core';

export class LeStatisticalUploadLog {
  id!: string;
  size!: number;
  url!: string;
  UID?: string;
  AppID!: string;
  merchantId!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeStatisticalUploadLogSchema = new EntitySchema({
  class: LeStatisticalUploadLog,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    size: { type: 'number' },
    url: { type: 'string', length: 255 },
    UID: { type: 'string', fieldName: 'UID', columnType: 'bigint', nullable: true },
    AppID: { type: 'string', fieldName: 'AppID', length: 50, index: '应用id' },
    merchantId: { type: 'string', columnType: 'bigint', index: '商户id' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
